#ifndef __BBHEAD_CHEADBOX_H_
#define __BBHEAD_CHEADBOX_H_

#include <robot/robot.h>
#include <robot/sdh/enums.h>
#include <blackbox/bbox.h>
#include <blackbox/cdataout.h>
#include <blackbox/cmethod.h>
#include <blackbox/carrayout.h>

#include <buola/io/csocket.h>
#include <buola/xml.h>

#include <array>

namespace buola { namespace robot { namespace pacohead {

class CHeadBox : public blackbox::BBox
{
public:
    CHeadBox();

private:
    void InitHead();
    
    void OnSetJoints(const std::array<double,7> &pJoints);
    void OnStop();
    void OnPullJoints();
    void OnPullStatus();
    void OnDoReset();
    
public:
    blackbox::CArrayOut<double,blackbox::NPullOutput> oJoints;
    blackbox::CMethod<void(std::array<double,7>)> mSetJoints;
    blackbox::CMethod<void()> mStop;
    blackbox::CMethod<void()> mDoReset;
    blackbox::CDataOut<int,blackbox::NPullOutput> oStatus;

private:
    io::CSocketStream mSocket;
};

/*namespace pacohead*/ } /*namespace robot*/ } /*namespace buola*/ }

#endif
